qx.Class.define("lastfmbackup.view.AbstractButtonBar", {
  
  extend    : qx.core.Object,
  implement : lastfmbackup.view.IElement,  
  type      : "abstract",
  
  events : {

    /**
     *  Fired when a button is clicked
     */
    execute : "qx.event.type.Data"
    
  },
  
  construct : function()
  {
    this.base(arguments);
    
    this._element = q.create(this._getTemplate());
    this._element.find("button").on("click", this._onButtonClick, this);
  },
  
  members : {
    
    _element : null,
    
    
    getElement : function()
    {
      return this._element;
    },
    
    _getTemplate : function()
    {
      throw new Error("Be overriden");
    },
    
    _onButtonClick : function(event)
    {
      this.fireDataEvent("execute", event.target.className.split(" ")[0].split("-")[1]);
      event.preventDefault();
    }
    
  }
  
});